Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catherine derrick/error banner and coupon display #296

Merged
merged 9 commits into from
Aug 22, 2023

Conversation

derrick-yyang
Copy link
Contributor

@derrick-yyang derrick-yyang commented Aug 7, 2023

Notion ticket link

Cancellation-Refund-Populate-camper-selection-page-with-real-data-edge-cases

Implementation description

  • Implemented a GET endpoint that retrieves discount information from stripe
  • Leveraged the endpoint to display discount information (if any). Here is a screenshot of what it looks like:image Note: When the initial Spinner/loading screen will continue until the information from stripe is successfully retrieved, aka error handled gracefully.
  • Added logic to display a banner when sessions are disabled and have the Total Refund = 0. Here is a screenshot: image
  • Disabled the Request Refund button if either: None of the cards are selected, or refund is disabled
  • PR feedback: Discount is distributed proportionally to cards selected. Here is a screenshot:
    fix-distribute discount to be proportional to selected refund cards

I also added a unrelated change that is a nice-to-have:

  • The Total Refund value now changes based on what card is checked. Discount also works with this.

Steps to test

  1. Not sure how to test the discount, are there any chargeId's with applied coupons? In that case, we can hard-code it and view it in the UI. The screenshot above is when it's hardcoded to show even if the discount is 0
  2. Go to this link: http://localhost:3000/refund/0013cb7b1f3a5325. Check to see if the Request Refund Button is disabled when nothing is selected and also make sure the error banner does not appear. Also select/de-select to see if the Total Refund is updated correctly each time
  3. Go to this link: http://localhost:3000/refund/73cf6242a9dfbdd2. Make sure the Request Refund Button is disabled and the banner shows
  4. Go to this link: http://localhost:3000/refund/5e74cb1c47b51ab0. Make sure discount ( TEST15 = 15%) changes proportionally to cards that are selected. Ensure the refund amount - discount is correct calculation. Do this check for session cards that have different prices.

What should reviewers focus on?

  • Does the UI look fine?

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

@derrick-yyang derrick-yyang temporarily deployed to fon-preview August 7, 2023 01:27 — with GitHub Actions Inactive
@derrick-yyang derrick-yyang marked this pull request as ready for review August 7, 2023 01:30
@github-actions
Copy link

github-actions bot commented Aug 7, 2023

Visit the preview URL for this PR (updated for commit 9a35df8):

https://focus-on-nature--pr296-catherine-derrick-er-qm75l6ns.web.app

(expires Tue, 22 Aug 2023 02:03:43 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 0aeb3dd1cc2aa82265739c366a8befd0d956fd1f

@derrick-yyang derrick-yyang temporarily deployed to fon-preview August 7, 2023 01:35 — with GitHub Actions Inactive
@BraydenRoyston
Copy link
Contributor

Stumbled upon a semi-gnarly edge case, check out this link: http://localhost:3000/refund/f874e4acfbbf3bb7.

  • Discounted refund
  • Within 30 days

Gives us this weird error state with a negative refund.

image

Alternate link with two campers: http://localhost:3000/refund/5015d9ac457f53a4

Possible Workaround:
When no campers are selected, do not display the discount amount. Note that you'll have to remove it from the total refund calculation, or perhaps even better is to take ceiling(refundAmount, 0);

!!! One more thing to test !!!

  1. Make a camp with a future session date (i.e., making a refund is valid)
  2. Sign up with two or more campers.
  3. Use discount code TEST15 in the stripe checkout to apply a discount.
  4. Verify in the refund flow that the discount is being distributed on a pro rata basis amongst each camper (if you have 2 campers and received a total discount of $100, only $50 of the discount should apply when refunding just one camper)

@BraydenRoyston
Copy link
Contributor

Other than those callouts, this is looking great. Excellent job and good call on updating the refund amount based on what cards are selected. I like it!

@derrick-yyang derrick-yyang temporarily deployed to fon-preview August 12, 2023 20:22 — with GitHub Actions Inactive
@xiec1377 xiec1377 temporarily deployed to fon-preview August 15, 2023 01:51 — with GitHub Actions Inactive
@xiec1377 xiec1377 temporarily deployed to fon-preview August 15, 2023 02:00 — with GitHub Actions Inactive
Copy link
Contributor

@xiec1377 xiec1377 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@BraydenRoyston BraydenRoyston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great!

@BraydenRoyston BraydenRoyston merged commit 4275f0e into dev Aug 22, 2023
3 checks passed
BraydenRoyston added a commit that referenced this pull request Oct 30, 2023
* Refactor: Updates invite link in waitlist registration email #244

* Feat: Waitlist registration entry  (#237)

* Feat: Add personal info and emergency contact questions step1 (#238)

* Review Registration Personal Info (#223)

* Rebase

* Address PR comments, organize code to remove duplication

* Lint

* Rebase

* Address PR comments, organize code to remove duplication

* Lint

* Lint

* Add visited verification on review summary page.

* Add new dependency after resolving merge conflict.

* Address comments

* Registrant Experience: Review Information Step (Additional Info) (#246)

* Add and implement EditCardHeader

* Edit styles in additional question groups to support responsiveness

* Add additional info edit card and edit prop names for consistency

* Make all styles consistent.

* Lint

* Add error validation on save

* Add image upload to camp creation (#224)

* Add image upload to camp creation

* aspect ratio fixes

* Add error handling so that when a user tries to click next, errors are shown (if any).

Co-authored-by: twilkhoo <[email protected]>

* Fix: Safari time picker (#248)

* fix: require province to proceed (#252)

* Fix: camp creation validator logic (#249)

* Fix: camp creation validator logic

* Add EDLP logic

* Fix merge conflict error with the VStack

Co-authored-by: twilkhoo <[email protected]>
Co-authored-by: Tejas Wilkhoo <[email protected]>

* Move campers modal (#247)

* update 'updateCamperByids' to allow moving between sessions

* very rough draft of full implementation

* remove console.log + added deleteActionCleanUp to reset the selected camper

* yarn fix + fix unimported components + remove console.log

* yarn for backend

* add check to find earliest and latest session date

* Lint

* Fix cancel button logic

* Lint + var rename

* styling changes + change html to chakra comps

Co-authored-by: twilkhoo <[email protected]>

* fix: session date ordering, hide completed sessions (#245)

* fix: session date ordering, hide completed sessions

* more ordering

* ordering and loading states

* Fix: Call Remove waitlisted camper only once (#255)

* Commit all changes

* Close before processing for deleting a camp also.

* Add wait list step 1 (#219)

* rebasing 'change routes to load waitlist registration + implement waitlist registration pages'

* fix age display

* remove generic footer + edit & use waitlist footer + shrink page top padding

* revert changes to formatSessionInfo back to what was in dev

* fix failed checkout url redirect bug

* Registrant Experience: Review Information Step (Add PersonalInfo and EmergencyContactQuestionsto EditCamperCard/ContactCard components) (#254)

* Commit all changes

* Remove spacer to make styles consistent

* Lint.

* Fix: Display EDLP tag applicable to a session (#258)

* Commit changes

* Address changes

* add check to ensure that at least one multiple choice option has text (#259)

* add check to ensure that at least one multiple choice option has text

* lint

* remove console.log

* Add error handling for whitespace options and require at least two options for multiple choice

---------

Co-authored-by: twilkhoo <[email protected]>

* Resolve error when registering for non-existant camp (#260)

* Commit changes

* Lint

* Add notFound comment.

* Lint.

* Waitlist backend call (#262)

* added adding waitlist campers call to the frontend

* use error message from backend api for registering waitlist camper

* run lint

* err msg change + variable name change

* Add "and" and period.

---------

Co-authored-by: twilkhoo <[email protected]>

* Registrant Experience: Review Information Step (EDLP) (#263)

* Commit all changes.

* Change type of setRequireEdlp to use React.Dispatch.

* Commit all changes. (#266)

* Fix camper edit functionality (#264)

* Commit all changes.

* Fix clicking a camper twice.

* Commit all changes. (#265)

* Add legacy openssl flag to build command (#271)

* Add a temp comment to track status before updating deps.

* Update react-scripts to v5 and test.

* Try using a legacy openssl flag to work around the conflicting hash error.

* Resolve uncaught error when viewing camp and fix coordinator/counsellor/volunteer editing (#267)

* Commit all changes.

* Create another endpoint for when we want to create new camp sessions.

* Consolidate changes into one endpoint.

* Fix: Manage sessions doesn’t persist. (#268)

* Add fields in schema to sort waitlisted campers (by date created). (#269)

* fix: docker build failing on old line (#272)

* fix: prevent duplicate multiple choice (#273)

* fix: prevent duplicates in multiple choice

* refactor: use enum for option error handling

* style: more descriptive names and clean up eslint warnings

* fix: Add current session date validation on camp creation flow (#274)

* added error message when trying to move to next page with no dates selected in session camp card

* fix: frontend lint fixes

* fix: PR Feeback

---------

Co-authored-by: Derrick Yang <[email protected]>

* Aaron/fix email validation (#277)

* feat: added two email verification tests

* feat: initial code for deep email validation check

* fix: removed deep-email-validator logic

* fix: removed deep-email-validator imports

* bug: removed unneeded dependencies and package bug

* feat: camper selection frontend (#281)

* feat: WIP, homepage of CamperCancellationRefund flow

* feat: WIP rough in refund page and component

* feat: WIP design layout of cancellation card

* feat: add RefundDTO

* feat: add refund dummy endpoint

* fix: lint

* fix: CSS

* feat: WIP hooked up backend

Co-authored-by: Nathan Souphanthong <[email protected]>

* fix: syntax fix to use map function for refund card

* feat: WIP, added information according to backend data onto CamperRefundInfoCards

* fix: added start/end time

Co-authored-by: Nathan Souphanthong <[email protected]>

* fix: WIP EDLP Time and grouping sessions based on name

Co-authored-by: Nathan Souphanthong <[email protected]>

* feat: Added EDLP Time calculation

* fix: unneeded syntax

* fix: remove console log

* fix: formatting for multiplace instances

* fix: vstack width

* feat: disabled state for when first session is < 30 days

* fix: lint

* feat: added refundCode to URL

* fix: PR feedback

---------

Co-authored-by: Nathan <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>

* feat: add refund link generation (#276)

 * feature: unique refund link generation

---------

Co-authored-by: Tina <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>

* Setup Stripe webhooks (#250)

* Setup Stripe webhooks

---------

Co-authored-by: Nathan <[email protected]>

* fix: sorted session dates in registration emails (#278)

* fix: sorted session dates in registration emails

* bug: fixed linting issue with return

* fix: allow user to deselect multiselect options containing commas (#279)

* feat: batch process camper cancellations (#282)

* feat: batch process camper cancellations

* fix: allow user to change from short answer to multiple choice with rendered default option (#283)

* chore: fix lint (#284)

* Nathan tina/add discount amount to confirmation email (#286)

* Add discount amount to confirmation email (Nathan/Tina)

---------

Co-authored-by: Tina <[email protected]>

* feat: add check for registrationResult (#288)

* fix: refund cancellation fix updates (#289)

* fix: Code readibility and frontend fixes

Co-authored-by: Catherine Xie <[email protected]>

* fix: removed error

* fix: Added total refund at the bottom

* fix: Remove EDLP if it's 0$

* fix: WIP redirect when given wrong refund code

* fix: error handled gracefully from API

* feat: Added spinner styling when loading:

* fix: linting

* fix: textStyle for dynamic page sizing

* fix: button sizing for dynamic page size

* fix: linting

* fix: lint

* fix: Linting

* fix: Address PR Comments

* fix: Address PR Comments

* fix: Removed any warning by adding type

* fix: linting fix

* fix: linting fix

* fix: deleted unexpected console statement

---------

Co-authored-by: Derrick Yang <[email protected]>

* Add form validation to email in registration (#290)

* feat: add regex check to validate email

* fix: use existing checkEmail function

* Catherine derrick/error banner and coupon display (#296)

* feat: Added endpoint to retrieve discount info from stripe checkout session chargeId

* feat: Added frontend code to display refund amount, if any

* feat: Added error banner if cards are disabled

* feat: Refactored code so total refund changes based on selected cards

* feat: Added disable logic for button in the footer

* fix: linting

* fix: PR feedback - fixed negative discount total refund

* fix: PR feedback - distribute discount to be proportional to selected refund cards

* fix: linting

---------

Co-authored-by: Catherine Xie <[email protected]>

* feat: add validation for non-negative EDLP amount (#294)

* feat: add validation for non-negative EDLP amount

* fix: lint

* feat[BE]: add user refund flow (#291)

* feat: batch process camper cancellations

* feat: factor out Stripe refund creation

* refactor: use Promise all instead of await in loop

* feat: added new field "refundStatus" to camper obj

* fix: add refundstatus field for camp+camperservice

* fix: add refundStatus in more objects

* fix: changed variable names and refund status

* chore: changed "Not Refunded" status to "Paid"

* feat: added new field paymentintentid to camper

* fix: edit camper object with paymentintentid

* fix: included paymentintentid in cancellation func

* brayden/webhook integration

* fix: remove paymentintent, change cancel flow

* fix: fixed stripe api bug

* fix: patched refundstatus not updating in db

* fix: linting fixes

---------

Co-authored-by: Tina <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: BraydenRoyston <[email protected]>

* Derrick catherine/send data on request refund (#295)

* fix: add empty dep array so useEffect is only called once

* Added functionality to request refund so it calls a dummy endpoint

Co-authored-by: Catherine Xie <[email protected]>

* feat: Added functionality to request refund so it calls a dummy endpoint

Co-authored-by: Catherine Xie <[email protected]>

* feat: Added loading for requestRefund button

* fix: lint

* fix: margin adjustment

* chore: lint

---------

Co-authored-by: Catherine Xie <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: BraydenRoyston <[email protected]>

* feat[FE]: add refund confirmation page (#293)

* feat: add refund confirmation page

---------

Co-authored-by: BraydenRoyston <[email protected]>

---------

Co-authored-by: Dhruv Mittal <[email protected]>
Co-authored-by: Tejas Wilkhoo <[email protected]>
Co-authored-by: e-wai <[email protected]>
Co-authored-by: twilkhoo <[email protected]>
Co-authored-by: TW1234567 <[email protected]>
Co-authored-by: Ivan Yu <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: thywang <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>
Co-authored-by: Derrick Yang <[email protected]>
Co-authored-by: Acezhang09 <[email protected]>
Co-authored-by: Derrick Yang <[email protected]>
Co-authored-by: Nathan <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>
Co-authored-by: Tina <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: Catherine Xie <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
BraydenRoyston added a commit that referenced this pull request Nov 4, 2023
* Refactor: Updates invite link in waitlist registration email #244

* Feat: Waitlist registration entry  (#237)

* Feat: Add personal info and emergency contact questions step1 (#238)

* Review Registration Personal Info (#223)

* Rebase

* Address PR comments, organize code to remove duplication

* Lint

* Rebase

* Address PR comments, organize code to remove duplication

* Lint

* Lint

* Add visited verification on review summary page.

* Add new dependency after resolving merge conflict.

* Address comments

* Registrant Experience: Review Information Step (Additional Info) (#246)

* Add and implement EditCardHeader

* Edit styles in additional question groups to support responsiveness

* Add additional info edit card and edit prop names for consistency

* Make all styles consistent.

* Lint

* Add error validation on save

* Add image upload to camp creation (#224)

* Add image upload to camp creation

* aspect ratio fixes

* Add error handling so that when a user tries to click next, errors are shown (if any).

Co-authored-by: twilkhoo <[email protected]>

* Fix: Safari time picker (#248)

* fix: require province to proceed (#252)

* Fix: camp creation validator logic (#249)

* Fix: camp creation validator logic

* Add EDLP logic

* Fix merge conflict error with the VStack

Co-authored-by: twilkhoo <[email protected]>
Co-authored-by: Tejas Wilkhoo <[email protected]>

* Move campers modal (#247)

* update 'updateCamperByids' to allow moving between sessions

* very rough draft of full implementation

* remove console.log + added deleteActionCleanUp to reset the selected camper

* yarn fix + fix unimported components + remove console.log

* yarn for backend

* add check to find earliest and latest session date

* Lint

* Fix cancel button logic

* Lint + var rename

* styling changes + change html to chakra comps

Co-authored-by: twilkhoo <[email protected]>

* fix: session date ordering, hide completed sessions (#245)

* fix: session date ordering, hide completed sessions

* more ordering

* ordering and loading states

* Fix: Call Remove waitlisted camper only once (#255)

* Commit all changes

* Close before processing for deleting a camp also.

* Add wait list step 1 (#219)

* rebasing 'change routes to load waitlist registration + implement waitlist registration pages'

* fix age display

* remove generic footer + edit & use waitlist footer + shrink page top padding

* revert changes to formatSessionInfo back to what was in dev

* fix failed checkout url redirect bug

* Registrant Experience: Review Information Step (Add PersonalInfo and EmergencyContactQuestionsto EditCamperCard/ContactCard components) (#254)

* Commit all changes

* Remove spacer to make styles consistent

* Lint.

* Fix: Display EDLP tag applicable to a session (#258)

* Commit changes

* Address changes

* add check to ensure that at least one multiple choice option has text (#259)

* add check to ensure that at least one multiple choice option has text

* lint

* remove console.log

* Add error handling for whitespace options and require at least two options for multiple choice

---------

Co-authored-by: twilkhoo <[email protected]>

* Resolve error when registering for non-existant camp (#260)

* Commit changes

* Lint

* Add notFound comment.

* Lint.

* Waitlist backend call (#262)

* added adding waitlist campers call to the frontend

* use error message from backend api for registering waitlist camper

* run lint

* err msg change + variable name change

* Add "and" and period.

---------

Co-authored-by: twilkhoo <[email protected]>

* Registrant Experience: Review Information Step (EDLP) (#263)

* Commit all changes.

* Change type of setRequireEdlp to use React.Dispatch.

* Commit all changes. (#266)

* Fix camper edit functionality (#264)

* Commit all changes.

* Fix clicking a camper twice.

* Commit all changes. (#265)

* Add legacy openssl flag to build command (#271)

* Add a temp comment to track status before updating deps.

* Update react-scripts to v5 and test.

* Try using a legacy openssl flag to work around the conflicting hash error.

* Resolve uncaught error when viewing camp and fix coordinator/counsellor/volunteer editing (#267)

* Commit all changes.

* Create another endpoint for when we want to create new camp sessions.

* Consolidate changes into one endpoint.

* Fix: Manage sessions doesn’t persist. (#268)

* Add fields in schema to sort waitlisted campers (by date created). (#269)

* fix: docker build failing on old line (#272)

* fix: prevent duplicate multiple choice (#273)

* fix: prevent duplicates in multiple choice

* refactor: use enum for option error handling

* style: more descriptive names and clean up eslint warnings

* fix: Add current session date validation on camp creation flow (#274)

* added error message when trying to move to next page with no dates selected in session camp card

* fix: frontend lint fixes

* fix: PR Feeback

---------

Co-authored-by: Derrick Yang <[email protected]>

* Aaron/fix email validation (#277)

* feat: added two email verification tests

* feat: initial code for deep email validation check

* fix: removed deep-email-validator logic

* fix: removed deep-email-validator imports

* bug: removed unneeded dependencies and package bug

* feat: camper selection frontend (#281)

* feat: WIP, homepage of CamperCancellationRefund flow

* feat: WIP rough in refund page and component

* feat: WIP design layout of cancellation card

* feat: add RefundDTO

* feat: add refund dummy endpoint

* fix: lint

* fix: CSS

* feat: WIP hooked up backend

Co-authored-by: Nathan Souphanthong <[email protected]>

* fix: syntax fix to use map function for refund card

* feat: WIP, added information according to backend data onto CamperRefundInfoCards

* fix: added start/end time

Co-authored-by: Nathan Souphanthong <[email protected]>

* fix: WIP EDLP Time and grouping sessions based on name

Co-authored-by: Nathan Souphanthong <[email protected]>

* feat: Added EDLP Time calculation

* fix: unneeded syntax

* fix: remove console log

* fix: formatting for multiplace instances

* fix: vstack width

* feat: disabled state for when first session is < 30 days

* fix: lint

* feat: added refundCode to URL

* fix: PR feedback

---------

Co-authored-by: Nathan <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>

* feat: add refund link generation (#276)

 * feature: unique refund link generation

---------

Co-authored-by: Tina <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>

* Setup Stripe webhooks (#250)

* Setup Stripe webhooks

---------

Co-authored-by: Nathan <[email protected]>

* fix: sorted session dates in registration emails (#278)

* fix: sorted session dates in registration emails

* bug: fixed linting issue with return

* fix: allow user to deselect multiselect options containing commas (#279)

* feat: batch process camper cancellations (#282)

* feat: batch process camper cancellations

* fix: allow user to change from short answer to multiple choice with rendered default option (#283)

* chore: fix lint (#284)

* Nathan tina/add discount amount to confirmation email (#286)

* Add discount amount to confirmation email (Nathan/Tina)

---------

Co-authored-by: Tina <[email protected]>

* feat: add check for registrationResult (#288)

* fix: refund cancellation fix updates (#289)

* fix: Code readibility and frontend fixes

Co-authored-by: Catherine Xie <[email protected]>

* fix: removed error

* fix: Added total refund at the bottom

* fix: Remove EDLP if it's 0$

* fix: WIP redirect when given wrong refund code

* fix: error handled gracefully from API

* feat: Added spinner styling when loading:

* fix: linting

* fix: textStyle for dynamic page sizing

* fix: button sizing for dynamic page size

* fix: linting

* fix: lint

* fix: Linting

* fix: Address PR Comments

* fix: Address PR Comments

* fix: Removed any warning by adding type

* fix: linting fix

* fix: linting fix

* fix: deleted unexpected console statement

---------

Co-authored-by: Derrick Yang <[email protected]>

* Add form validation to email in registration (#290)

* feat: add regex check to validate email

* fix: use existing checkEmail function

* Catherine derrick/error banner and coupon display (#296)

* feat: Added endpoint to retrieve discount info from stripe checkout session chargeId

* feat: Added frontend code to display refund amount, if any

* feat: Added error banner if cards are disabled

* feat: Refactored code so total refund changes based on selected cards

* feat: Added disable logic for button in the footer

* fix: linting

* fix: PR feedback - fixed negative discount total refund

* fix: PR feedback - distribute discount to be proportional to selected refund cards

* fix: linting

---------

Co-authored-by: Catherine Xie <[email protected]>

* feat: add validation for non-negative EDLP amount (#294)

* feat: add validation for non-negative EDLP amount

* fix: lint

* feat[BE]: add user refund flow (#291)

* feat: batch process camper cancellations

* feat: factor out Stripe refund creation

* refactor: use Promise all instead of await in loop

* feat: added new field "refundStatus" to camper obj

* fix: add refundstatus field for camp+camperservice

* fix: add refundStatus in more objects

* fix: changed variable names and refund status

* chore: changed "Not Refunded" status to "Paid"

* feat: added new field paymentintentid to camper

* fix: edit camper object with paymentintentid

* fix: included paymentintentid in cancellation func

* brayden/webhook integration

* fix: remove paymentintent, change cancel flow

* fix: fixed stripe api bug

* fix: patched refundstatus not updating in db

* fix: linting fixes

---------

Co-authored-by: Tina <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: BraydenRoyston <[email protected]>

* Derrick catherine/send data on request refund (#295)

* fix: add empty dep array so useEffect is only called once

* Added functionality to request refund so it calls a dummy endpoint

Co-authored-by: Catherine Xie <[email protected]>

* feat: Added functionality to request refund so it calls a dummy endpoint

Co-authored-by: Catherine Xie <[email protected]>

* feat: Added loading for requestRefund button

* fix: lint

* fix: margin adjustment

* chore: lint

---------

Co-authored-by: Catherine Xie <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: BraydenRoyston <[email protected]>

* feat[FE]: add refund confirmation page (#293)

* feat: add refund confirmation page

---------

Co-authored-by: BraydenRoyston <[email protected]>

* hotfix[users cannot sign in]: fix for pre-existing cors issue on prod that client encountered

---------

Co-authored-by: Dhruv Mittal <[email protected]>
Co-authored-by: Tejas Wilkhoo <[email protected]>
Co-authored-by: e-wai <[email protected]>
Co-authored-by: twilkhoo <[email protected]>
Co-authored-by: TW1234567 <[email protected]>
Co-authored-by: Ivan Yu <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: thywang <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>
Co-authored-by: Derrick Yang <[email protected]>
Co-authored-by: Acezhang09 <[email protected]>
Co-authored-by: Derrick Yang <[email protected]>
Co-authored-by: Nathan <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>
Co-authored-by: Tina <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: Catherine Xie <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
BraydenRoyston added a commit that referenced this pull request Dec 17, 2023
* Refactor: Updates invite link in waitlist registration email #244

* Feat: Waitlist registration entry  (#237)

* Feat: Add personal info and emergency contact questions step1 (#238)

* Review Registration Personal Info (#223)

* Rebase

* Address PR comments, organize code to remove duplication

* Lint

* Rebase

* Address PR comments, organize code to remove duplication

* Lint

* Lint

* Add visited verification on review summary page.

* Add new dependency after resolving merge conflict.

* Address comments

* Registrant Experience: Review Information Step (Additional Info) (#246)

* Add and implement EditCardHeader

* Edit styles in additional question groups to support responsiveness

* Add additional info edit card and edit prop names for consistency

* Make all styles consistent.

* Lint

* Add error validation on save

* Add image upload to camp creation (#224)

* Add image upload to camp creation

* aspect ratio fixes

* Add error handling so that when a user tries to click next, errors are shown (if any).

Co-authored-by: twilkhoo <[email protected]>

* Fix: Safari time picker (#248)

* fix: require province to proceed (#252)

* Fix: camp creation validator logic (#249)

* Fix: camp creation validator logic

* Add EDLP logic

* Fix merge conflict error with the VStack

Co-authored-by: twilkhoo <[email protected]>
Co-authored-by: Tejas Wilkhoo <[email protected]>

* Move campers modal (#247)

* update 'updateCamperByids' to allow moving between sessions

* very rough draft of full implementation

* remove console.log + added deleteActionCleanUp to reset the selected camper

* yarn fix + fix unimported components + remove console.log

* yarn for backend

* add check to find earliest and latest session date

* Lint

* Fix cancel button logic

* Lint + var rename

* styling changes + change html to chakra comps

Co-authored-by: twilkhoo <[email protected]>

* fix: session date ordering, hide completed sessions (#245)

* fix: session date ordering, hide completed sessions

* more ordering

* ordering and loading states

* Fix: Call Remove waitlisted camper only once (#255)

* Commit all changes

* Close before processing for deleting a camp also.

* Add wait list step 1 (#219)

* rebasing 'change routes to load waitlist registration + implement waitlist registration pages'

* fix age display

* remove generic footer + edit & use waitlist footer + shrink page top padding

* revert changes to formatSessionInfo back to what was in dev

* fix failed checkout url redirect bug

* Registrant Experience: Review Information Step (Add PersonalInfo and EmergencyContactQuestionsto EditCamperCard/ContactCard components) (#254)

* Commit all changes

* Remove spacer to make styles consistent

* Lint.

* Fix: Display EDLP tag applicable to a session (#258)

* Commit changes

* Address changes

* add check to ensure that at least one multiple choice option has text (#259)

* add check to ensure that at least one multiple choice option has text

* lint

* remove console.log

* Add error handling for whitespace options and require at least two options for multiple choice

---------

Co-authored-by: twilkhoo <[email protected]>

* Resolve error when registering for non-existant camp (#260)

* Commit changes

* Lint

* Add notFound comment.

* Lint.

* Waitlist backend call (#262)

* added adding waitlist campers call to the frontend

* use error message from backend api for registering waitlist camper

* run lint

* err msg change + variable name change

* Add "and" and period.

---------

Co-authored-by: twilkhoo <[email protected]>

* Registrant Experience: Review Information Step (EDLP) (#263)

* Commit all changes.

* Change type of setRequireEdlp to use React.Dispatch.

* Commit all changes. (#266)

* Fix camper edit functionality (#264)

* Commit all changes.

* Fix clicking a camper twice.

* Commit all changes. (#265)

* Add legacy openssl flag to build command (#271)

* Add a temp comment to track status before updating deps.

* Update react-scripts to v5 and test.

* Try using a legacy openssl flag to work around the conflicting hash error.

* Resolve uncaught error when viewing camp and fix coordinator/counsellor/volunteer editing (#267)

* Commit all changes.

* Create another endpoint for when we want to create new camp sessions.

* Consolidate changes into one endpoint.

* Fix: Manage sessions doesn’t persist. (#268)

* Add fields in schema to sort waitlisted campers (by date created). (#269)

* fix: docker build failing on old line (#272)

* fix: prevent duplicate multiple choice (#273)

* fix: prevent duplicates in multiple choice

* refactor: use enum for option error handling

* style: more descriptive names and clean up eslint warnings

* fix: Add current session date validation on camp creation flow (#274)

* added error message when trying to move to next page with no dates selected in session camp card

* fix: frontend lint fixes

* fix: PR Feeback

---------

Co-authored-by: Derrick Yang <[email protected]>

* Aaron/fix email validation (#277)

* feat: added two email verification tests

* feat: initial code for deep email validation check

* fix: removed deep-email-validator logic

* fix: removed deep-email-validator imports

* bug: removed unneeded dependencies and package bug

* feat: camper selection frontend (#281)

* feat: WIP, homepage of CamperCancellationRefund flow

* feat: WIP rough in refund page and component

* feat: WIP design layout of cancellation card

* feat: add RefundDTO

* feat: add refund dummy endpoint

* fix: lint

* fix: CSS

* feat: WIP hooked up backend

Co-authored-by: Nathan Souphanthong <[email protected]>

* fix: syntax fix to use map function for refund card

* feat: WIP, added information according to backend data onto CamperRefundInfoCards

* fix: added start/end time

Co-authored-by: Nathan Souphanthong <[email protected]>

* fix: WIP EDLP Time and grouping sessions based on name

Co-authored-by: Nathan Souphanthong <[email protected]>

* feat: Added EDLP Time calculation

* fix: unneeded syntax

* fix: remove console log

* fix: formatting for multiplace instances

* fix: vstack width

* feat: disabled state for when first session is < 30 days

* fix: lint

* feat: added refundCode to URL

* fix: PR feedback

---------

Co-authored-by: Nathan <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>

* feat: add refund link generation (#276)

 * feature: unique refund link generation

---------

Co-authored-by: Tina <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>

* Setup Stripe webhooks (#250)

* Setup Stripe webhooks

---------

Co-authored-by: Nathan <[email protected]>

* fix: sorted session dates in registration emails (#278)

* fix: sorted session dates in registration emails

* bug: fixed linting issue with return

* fix: allow user to deselect multiselect options containing commas (#279)

* feat: batch process camper cancellations (#282)

* feat: batch process camper cancellations

* fix: allow user to change from short answer to multiple choice with rendered default option (#283)

* chore: fix lint (#284)

* Nathan tina/add discount amount to confirmation email (#286)

* Add discount amount to confirmation email (Nathan/Tina)

---------

Co-authored-by: Tina <[email protected]>

* feat: add check for registrationResult (#288)

* fix: refund cancellation fix updates (#289)

* fix: Code readibility and frontend fixes

Co-authored-by: Catherine Xie <[email protected]>

* fix: removed error

* fix: Added total refund at the bottom

* fix: Remove EDLP if it's 0$

* fix: WIP redirect when given wrong refund code

* fix: error handled gracefully from API

* feat: Added spinner styling when loading:

* fix: linting

* fix: textStyle for dynamic page sizing

* fix: button sizing for dynamic page size

* fix: linting

* fix: lint

* fix: Linting

* fix: Address PR Comments

* fix: Address PR Comments

* fix: Removed any warning by adding type

* fix: linting fix

* fix: linting fix

* fix: deleted unexpected console statement

---------

Co-authored-by: Derrick Yang <[email protected]>

* Add form validation to email in registration (#290)

* feat: add regex check to validate email

* fix: use existing checkEmail function

* Catherine derrick/error banner and coupon display (#296)

* feat: Added endpoint to retrieve discount info from stripe checkout session chargeId

* feat: Added frontend code to display refund amount, if any

* feat: Added error banner if cards are disabled

* feat: Refactored code so total refund changes based on selected cards

* feat: Added disable logic for button in the footer

* fix: linting

* fix: PR feedback - fixed negative discount total refund

* fix: PR feedback - distribute discount to be proportional to selected refund cards

* fix: linting

---------

Co-authored-by: Catherine Xie <[email protected]>

* feat: add validation for non-negative EDLP amount (#294)

* feat: add validation for non-negative EDLP amount

* fix: lint

* feat[BE]: add user refund flow (#291)

* feat: batch process camper cancellations

* feat: factor out Stripe refund creation

* refactor: use Promise all instead of await in loop

* feat: added new field "refundStatus" to camper obj

* fix: add refundstatus field for camp+camperservice

* fix: add refundStatus in more objects

* fix: changed variable names and refund status

* chore: changed "Not Refunded" status to "Paid"

* feat: added new field paymentintentid to camper

* fix: edit camper object with paymentintentid

* fix: included paymentintentid in cancellation func

* brayden/webhook integration

* fix: remove paymentintent, change cancel flow

* fix: fixed stripe api bug

* fix: patched refundstatus not updating in db

* fix: linting fixes

---------

Co-authored-by: Tina <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: BraydenRoyston <[email protected]>

* Derrick catherine/send data on request refund (#295)

* fix: add empty dep array so useEffect is only called once

* Added functionality to request refund so it calls a dummy endpoint

Co-authored-by: Catherine Xie <[email protected]>

* feat: Added functionality to request refund so it calls a dummy endpoint

Co-authored-by: Catherine Xie <[email protected]>

* feat: Added loading for requestRefund button

* fix: lint

* fix: margin adjustment

* chore: lint

---------

Co-authored-by: Catherine Xie <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: BraydenRoyston <[email protected]>

* feat[FE]: add refund confirmation page (#293)

* feat: add refund confirmation page

---------

Co-authored-by: BraydenRoyston <[email protected]>

* hotfix[users cannot sign in]: fix for pre-existing cors issue on prod that client encountered

* fix: added access-control-allow-origin header to auth routes (#299)

---------

Co-authored-by: Dhruv Mittal <[email protected]>
Co-authored-by: Tejas Wilkhoo <[email protected]>
Co-authored-by: e-wai <[email protected]>
Co-authored-by: twilkhoo <[email protected]>
Co-authored-by: TW1234567 <[email protected]>
Co-authored-by: Ivan Yu <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: thywang <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>
Co-authored-by: Derrick Yang <[email protected]>
Co-authored-by: Acezhang09 <[email protected]>
Co-authored-by: Derrick Yang <[email protected]>
Co-authored-by: Nathan <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>
Co-authored-by: Tina <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: Catherine Xie <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants